<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	
<%@include file="/include/head.jsp"%>

<div id="cc" class="easyui-layout" style="width:100%;height:100%;">   
	<div data-options="region:'center',title:'销售订单-<fmt:formatDate value="${vo.orderDate}" pattern="yyyy-MM-dd"/>信息'" style="padding:5px;background:#eee;">
		<form id="editForm"   method="post" enctype="multipart/form-data" >
			<input name="id" type="hidden" value="${vo.id}">
				<!-- 提交的时候存放子表订单明细信息 -->
				<input id="orderbData" name="orderbData" type="hidden" value="">
			<table cellpadding="0" cellspacing="1" class="formtable">
				<tr>
				<td align="right"><label class="Validform_label">客户姓名:</label></td>
				<td class="value">
				<input class="easyui-textbox" type="text"  id="cusName" name="cusName"
				 data-options="required:true,readonly:true" value="${vo.cusName}" />
				</td>
				<td align="right"><label class="Validform_label">订单日期:</label></td>
				<td class="value">
				<input class="easyui-datebox" type="text"  id="orderDate" name="orderDate"
				 data-options="required:true,readonly:true" value="<fmt:formatDate value="${vo.orderDate}" pattern="yyyy-MM-dd"/>" />
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">订单类型:</label></td>
				<td class="value">
				<input class="easyui-textbox" type="text"  id="orderType" name="orderType"
				 data-options="required:true,readonly:true" value="${vo.orderType}" />
				</td>
				<td align="right"><label class="Validform_label">总额:</label></td>
				<td class="value">
				<input class="easyui-numberbox" type="text"  id="totalAmount" name="totalAmount"
				 data-options="required:true,readonly:true,min:0,precision:2" value="${vo.totalAmount}" />
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">备注:</label></td>
				<td class="value">
				<input class="easyui-textbox" type="text"  id="remark" name="remark"
				 data-options="required:true,readonly:true" value="${vo.remark}" />
				</td>
				<td align="right"><label class="Validform_label">状态:</label></td>
				<td class="value">
				<select id="status" class="easyui-combobox" name="status" style="width:200px;" data-options="required:true,readonly:true">  
					<option value="0" <c:if test="${vo.status==0}">selected="selected"</c:if>>草稿</option>   
					<option value="1" <c:if test="${vo.status==1}">selected="selected"</c:if>>已确认</option>    
					<option value="5" <c:if test="${vo.status==5}">selected="selected"</c:if>>送货中</option>  
					<option value="10" <c:if test="${vo.status==10}">selected="selected"</c:if>>已完成</option>    
				</select>
				</td>
				</tr>
			</table>
		</form>
		<div id="tt" class="easyui-tabs" style="width:100%;height:300px;"> 
		 	<div title="订单明细" data-options="closable:false" style="overflow:auto;">   
	        	<table id="dg_orderb"> </table>    
	     	</div>   
		</div>
	</div>
	<div data-options="region:'south'" style="height:35px;text-align: center;padding-top: 5px">
	 	<a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="edit()" >修改</a>  
	 	<a id="btncancel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="closeDialog()">关闭</a>  
	 </div>
</div>
<script type="text/javascript">
var dialog = frameElement.dialog;
$(function() {
	 
	    initCurdDatagrid4Sub('orderb','dg_orderb',{
			title:null,
			pagination:false,
			nowrap:true,
			dwidth:'90%',//弹出对话框的宽度 百分比或者具体数字宽度
			dheight:'90%',//弹出对话框的高度 百分比或者具体数字宽度
			btnCtl:'',
			model:'${vo.id}'==''?'add':'edit',
			height:'100%',
			collapsible:false,//是否可折叠的 
			autoRowHeight:false,
			fitColumns:false,
			queryParams:{'orderhId':'${vo.id}'},
			baseUrl:'${ctx}/platform/orderb/',
			url:'${ctx}/platform/orderb/listAllData.do',
		    loadFilter: function(data){
				return data;
			},
			columns:[[
				        	{field:'extOrderNo',title:'外部订单编号',width:100,sortable:true},    
				        	{field:'productId',title:'产品ID',width:100,sortable:true,hidden:true},    
				        	{field:'productName',title:'产品名称',width:100,sortable:true},    
				        	{field:'productSpec',title:'产品规格',width:100,sortable:true},    
				        	{field:'unit',title:'单位',width:50,sortable:true},    
				        	{field:'productNum',title:'数量',width:60,sortable:true,formatter:formatInt},    
				        	{field:'unitPrice',title:'单价',width:60,sortable:true,formatter:formatDouble},    
				        	{field:'totalPrice',title:'总价',width:80,sortable:true,formatter:formatDouble},    
				        	{field:'recvId',title:'收货地址ID',width:100,sortable:true,hidden:true},    
				        	{field:'recvName',title:'收货单位',width:100,sortable:true},    
				        	{field:'recvAdd',title:'收货地址',width:100,sortable:true},    
				        	{field:'recvTel',title:'收货电话',width:100,sortable:true},    
				        	{field:'isPlanSend',title:'是否安排送货',width:100,sortable:true,formatter:formatSendStatus},    
				        	{field:'sendDate',title:'送货日期',width:100,sortable:true,formatter:formatDate},    
				        	{field:'sendWay',title:'送货方式',width:100,sortable:true},    
				        	{field:'deliveryman',title:'送货人',width:100,sortable:true},    
				        	{field:'isSigned',title:'是否签收',width:100,sortable:true},    
				        	{field:'signer',title:'签收人',width:100,sortable:true},    
				        	{field:'signDate',title:'签收日期',width:100,sortable:true}    
				    ]] 
		},[]);
	  
});

function edit(){
	document.location.href='editForm.do?id=${vo.id}';  
}
function closeDialog()
{
	dialog.dialog("close");
}

</script>
